library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.5 ✓ dplyr 1.0.7
## ✓ tidyr 1.1.3 ✓ stringr 1.4.0
## ✓ readr 2.0.1 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(readr)
library(rvest)
##
## Attaching package: 'rvest'
## The following object is masked from 'package:readr':
##
## guess_encoding
library(httr)
library(lubridate)
##
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
##
## date, intersect, setdiff, union
knitr::opts_chunk$set(
fig.width = 7,
fig.asp = .7,
out.width = "90%"
)
theme_set(theme_minimal() + theme(legend.position = "bottom"))
options(
ggplot2.continuous.colour = "viridis",
ggplot2.continuous.fill = "viridis",
scale_colour_discrete = scale_colour_viridis_d,
scale_fill_discrete = scale_fill_viridis_d
)
#Percent Hesitancy by county
library(plotly)
p <- df2 %>% rowwise() %>%
mutate(not_hesitant = 1 - sum(estimated_hesitant_or_unsure, estimated_hesitant, estimated_strongly_hesitant)*100,
total = sum(not_hesitant, estimated_hesitant_or_unsure, estimated_hesitant, estimated_strongly_hesitant),
any_hesitant = sum(estimated_hesitant_or_unsure, estimated_hesitant, estimated_strongly_hesitant)*100) %>%
rename(`Total Hesitancy`= any_hesitant) %>%
ggplot(mapping = aes(x = long, y = lat, group= group,
fill = `Total Hesitancy`,
text = paste0("State: ", str_to_title(state), "<br>",
"County: ", str_to_title(county))))
p1 <- p + geom_polygon(color = "gray90", size = 0.1) +
coord_map(projection = "albers", lat0 = 39, lat1 = 45) +
labs(fill = "Percent hesitant",
x = " ",
y = " ")
ggplotly(p1)
Participants were asked to identify their level of hesitancy from “hesitant”, “hesitant or unsure”, and “strongly hesitant”. This map depicts the total percent of any type hesitancy (sum of percent “hesitant”, “hesitant or unsure”, and “strongly hesitant”). Most counties appear to have about 40% and <40% of the population hesitant about getting the COVID-19 vaccine. The Southeast along with areas in the North (around Montana, Idaho, and Wyoming) have greater proportions of vaccine hesitancy.